<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateEmployeeInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('employeeInfo', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('cmpId')->comment('所属公司id,company表主键')->index();
            $table->integer('deptId')->comment('部门id');
            $table->string('name')->comment('姓名');
            $table->string('mobile')->comment('电话');
            $table->string('email')->comment('邮箱')->nullable();
            $table->string('position')->comment('职位')->nullable();
            $table->string('employeeNo')->comment('工号')->nullable();
            $table->integer('entryTime')->comment('入职时间')->nullable();
            $table->string('remarks')->comment('备注')->nullable();
            $table->tinyInteger('type')->default(0)->comment('是否部门主管 1：是 0：否');
            $table->tinyInteger('status')->default(0)->comment('是否删除 1：是 0：否');
            $table->integer('createdAt')->comment('创建时间');
            $table->integer('updatedAt')->comment('最后更新时间');
        });
        DB::statement("ALTER TABLE `employeeInfo` comment '员工信息表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('employeeInfo');
    }
}
